import request from '@/service'
import { IDataType } from '../../types'

// 1.请求数据
export function getPageListData(url: string, pageInfo: any) {
  return request.post<IDataType>({
    url: url,
    data: pageInfo
  })
}

// 2.删除数据
export function deletePageData(url: string) {
  return request.delete<IDataType>({
    url: url
  })
}

// 3.添加数据
export function createPageData(url: string, newData: any) {
  return request.post<IDataType>({
    url: url,
    data: newData
  })
}

// 4.编辑数据
export function editPageData(url: string, editData: any) {
  return request.patch<IDataType>({
    url: url,
    data: editData
  })
}
